<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>ReflectionMethod 类</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionfunctionabstract.tostring.html">ReflectionFunctionAbstract::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionmethod.construct.html">ReflectionMethod::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.reflectionmethod" class="reference">

 <h1 class="title">ReflectionMethod 类</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5)</p>


  <div class="section" id="reflectionmethod.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    <strong class="classname">ReflectionMethod</strong> 类报告了一个方法的有关信息。
   </p>
  </div>


  <div class="section" id="reflectionmethod.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">ReflectionMethod</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.reflectionfunctionabstract.html" class="classname">ReflectionFunctionAbstract</a>
     </span>
     
     <span class="oointerface">implements 
      <span class="interfacename"><a href="class.reflector.html" class="interfacename">Reflector</a></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-static"><var class="varname">IS_STATIC</var></a></var>
     <span class="initializer"> = 1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-public"><var class="varname">IS_PUBLIC</var></a></var>
     <span class="initializer"> = 256</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-protected"><var class="varname">IS_PROTECTED</var></a></var>
     <span class="initializer"> = 512</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-private"><var class="varname">IS_PRIVATE</var></a></var>
     <span class="initializer"> = 1024</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-abstract"><var class="varname">IS_ABSTRACT</var></a></var>
     <span class="initializer"> = 2</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionmethod.html#reflectionmethod.constants.is-final"><var class="varname">IS_FINAL</var></a></var>
     <span class="initializer"> = 4</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 属性 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionmethod.html#reflectionmethod.props.name">$<var class="varname">name</var></a></var>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">public</span>
      <var class="varname"><a href="class.reflectionmethod.html#reflectionmethod.props.class">$<var class="varname">class</var></a></var>
    ;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionmethod.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$class</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">string</span><span class="methodname"><a href="reflectionmethod.export.html" class="methodname">export</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$class</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$return</code><span class="initializer"> = false</span></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">Closure</span><span class="methodname"><a href="reflectionmethod.getclosure.html" class="methodname">getClosure</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionmethod.getdeclaringclass.html" class="methodname">getDeclaringClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionmethod.getmodifiers.html" class="methodname">getModifiers</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionMethod</span><span class="methodname"><a href="reflectionmethod.getprototype.html" class="methodname">getPrototype</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionmethod.invoke.html" class="methodname">invoke</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$parameter</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$...</code></span>
  ]] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">mixed</span><span class="methodname"><a href="reflectionmethod.invokeargs.html" class="methodname">invokeArgs</a></span>
    ( <span class="methodparam"><span class="type">object</span> <code class="parameter">$object</code></span>
   , <span class="methodparam"><span class="type">array</span> <code class="parameter">$args</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isabstract.html" class="methodname">isAbstract</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isconstructor.html" class="methodname">isConstructor</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isdestructor.html" class="methodname">isDestructor</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isfinal.html" class="methodname">isFinal</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isprivate.html" class="methodname">isPrivate</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isprotected.html" class="methodname">isProtected</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.ispublic.html" class="methodname">isPublic</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionmethod.isstatic.html" class="methodname">isStatic</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionmethod.setaccessible.html" class="methodname">setAccessible</a></span>
    ( <span class="methodparam"><span class="type">bool</span> <code class="parameter">$accessible</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionmethod.tostring.html" class="methodname">__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">private</span> <span class="type">void</span><span class="methodname"><a href="reflectionfunctionabstract.clone.html" class="methodname">ReflectionFunctionAbstract::__clone</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionClass</span><span class="methodname"><a href="reflectionfunctionabstract.getclosurescopeclass.html" class="methodname">ReflectionFunctionAbstract::getClosureScopeClass</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">object</span><span class="methodname"><a href="reflectionfunctionabstract.getclosurethis.html" class="methodname">ReflectionFunctionAbstract::getClosureThis</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getdoccomment.html" class="methodname">ReflectionFunctionAbstract::getDocComment</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getendline.html" class="methodname">ReflectionFunctionAbstract::getEndLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReflectionExtension</span><span class="methodname"><a href="reflectionfunctionabstract.getextension.html" class="methodname">ReflectionFunctionAbstract::getExtension</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getextensionname.html" class="methodname">ReflectionFunctionAbstract::getExtensionName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getfilename.html" class="methodname">ReflectionFunctionAbstract::getFileName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getname.html" class="methodname">ReflectionFunctionAbstract::getName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getnamespacename.html" class="methodname">ReflectionFunctionAbstract::getNamespaceName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getnumberofparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getnumberofrequiredparameters.html" class="methodname">ReflectionFunctionAbstract::getNumberOfRequiredParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionfunctionabstract.getparameters.html" class="methodname">ReflectionFunctionAbstract::getParameters</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">string</span><span class="methodname"><a href="reflectionfunctionabstract.getshortname.html" class="methodname">ReflectionFunctionAbstract::getShortName</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">int</span><span class="methodname"><a href="reflectionfunctionabstract.getstartline.html" class="methodname">ReflectionFunctionAbstract::getStartLine</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span><span class="methodname"><a href="reflectionfunctionabstract.getstaticvariables.html" class="methodname">ReflectionFunctionAbstract::getStaticVariables</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.innamespace.html" class="methodname">ReflectionFunctionAbstract::inNamespace</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isclosure.html" class="methodname">ReflectionFunctionAbstract::isClosure</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isdeprecated.html" class="methodname">ReflectionFunctionAbstract::isDeprecated</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isgenerator.html" class="methodname">ReflectionFunctionAbstract::isGenerator</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isinternal.html" class="methodname">ReflectionFunctionAbstract::isInternal</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.isuserdefined.html" class="methodname">ReflectionFunctionAbstract::isUserDefined</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">bool</span><span class="methodname"><a href="reflectionfunctionabstract.returnsreference.html" class="methodname">ReflectionFunctionAbstract::returnsReference</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="type">void</span><span class="methodname"><a href="reflectionfunctionabstract.tostring.html" class="methodname">ReflectionFunctionAbstract::__toString</a></span>
    ( <span class="methodparam">void</span>
   )</div>


   }</div>


  </div>

  

  <div class="section" id="reflectionmethod.props">
   <h2 class="title">属性</h2>
   <dl>

    
     <dt id="reflectionmethod.props.name"><var class="varname"><var class="varname">name</var></var></dt>

     <dd>

      <p class="para">Method name</p>
     </dd>

    
    
     <dt id="reflectionmethod.props.class"><var class="varname"><var class="varname">class</var></var></dt>

     <dd>

      <p class="para">Class name</p>
     </dd>

    
   </dl>

  </div>




  <div class="section" id="reflectionmethod.constants">
   <h2 class="title">预定义常量</h2>
   <div class="section" id="reflectionmethod.constants.modifiers">
    <h2 class="title">ReflectionMethod 修饰符</h2>
    <dl>


     
      <dt id="reflectionmethod.constants.is-static"><strong><code>ReflectionMethod::IS_STATIC</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是静态（static）的。</p>
      </dd>

     

     
      <dt id="reflectionmethod.constants.is-public"><strong><code>ReflectionMethod::IS_PUBLIC</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是 public 的。</p>
      </dd>

     

     
      <dt id="reflectionmethod.constants.is-protected"><strong><code>ReflectionMethod::IS_PROTECTED</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是 protected 的。</p>
      </dd>

     

     
      <dt id="reflectionmethod.constants.is-private"><strong><code>ReflectionMethod::IS_PRIVATE</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是 private 的。</p>
      </dd>

     

     
      <dt id="reflectionmethod.constants.is-abstract"><strong><code>ReflectionMethod::IS_ABSTRACT</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是 abstract 的。</p>
      </dd>

     

     
      <dt id="reflectionmethod.constants.is-final"><strong><code>ReflectionMethod::IS_FINAL</code></strong></dt>

      <dd>

       <p class="para">指示一个方法是 final 的。</p>
      </dd>

     

    </dl>

   </div>
  </div>



 </div>

 































































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionmethod.construct.html">ReflectionMethod::__construct</a> — Constructs a ReflectionMethod</li><li><a href="reflectionmethod.export.html">ReflectionMethod::export</a> — Export a reflection method.</li><li><a href="reflectionmethod.getclosure.html">ReflectionMethod::getClosure</a> — Returns a dynamically created closure for the method</li><li><a href="reflectionmethod.getdeclaringclass.html">ReflectionMethod::getDeclaringClass</a> — Gets declaring class for the reflected method.</li><li><a href="reflectionmethod.getmodifiers.html">ReflectionMethod::getModifiers</a> — Gets the method modifiers</li><li><a href="reflectionmethod.getprototype.html">ReflectionMethod::getPrototype</a> — Gets the method prototype (if there is one).</li><li><a href="reflectionmethod.invoke.html">ReflectionMethod::invoke</a> — Invoke</li><li><a href="reflectionmethod.invokeargs.html">ReflectionMethod::invokeArgs</a> — Invoke args</li><li><a href="reflectionmethod.isabstract.html">ReflectionMethod::isAbstract</a> — Checks if method is abstract</li><li><a href="reflectionmethod.isconstructor.html">ReflectionMethod::isConstructor</a> — Checks if method is a constructor</li><li><a href="reflectionmethod.isdestructor.html">ReflectionMethod::isDestructor</a> — Checks if method is a destructor</li><li><a href="reflectionmethod.isfinal.html">ReflectionMethod::isFinal</a> — Checks if method is final</li><li><a href="reflectionmethod.isprivate.html">ReflectionMethod::isPrivate</a> — Checks if method is private</li><li><a href="reflectionmethod.isprotected.html">ReflectionMethod::isProtected</a> — Checks if method is protected</li><li><a href="reflectionmethod.ispublic.html">ReflectionMethod::isPublic</a> — Checks if method is public</li><li><a href="reflectionmethod.isstatic.html">ReflectionMethod::isStatic</a> — Checks if method is static</li><li><a href="reflectionmethod.setaccessible.html">ReflectionMethod::setAccessible</a> — Set method accessibility</li><li><a href="reflectionmethod.tostring.html">ReflectionMethod::__toString</a> — Returns the string representation of the Reflection method object.</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="reflectionfunctionabstract.tostring.html">ReflectionFunctionAbstract::__toString</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="reflectionmethod.construct.html">ReflectionMethod::__construct</a></div>
 <div class="up"><a href="book.reflection.html">反射</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
